{% extends "admin/base.html" %}

{% block main %}
    <div class="box box-primary">
        <div class="box-header with-border"><h3 class="box-title">主要信息</h3></div>
        <div class="box-body">
            <form action="" method="post">
                <div class="form-group">
                    <label>题目编号</label>
                    <input type="text" class="form-control" placeholder="题目编号" value="{{ problem_data.id }}" disabled="">
                </div>
                <div class="form-group">
                    <label>题目名称</label>
                    <input type="text" class="form-control"  placeholder="题目名称" name="name" value="{{ problem_data.name }}">
                </div>
                <div class="form-group">
                    <label>题目描述(Markdown支持)</label>
                    <textarea class="form-control" rows="10" name="description" placeholder="题目描述">{{ problem_data.description }}</textarea>
                </div>
                <div class="form-group">
                    <label>题解(Markdown支持)</label>
                    <textarea class="form-control" rows="10" name="answer" placeholder="题解">{{ problem_data.answer }}</textarea>
                </div>
                <div class="row">
                    <div class="col-xs-4" style="float: left;">
                        <button type="submit" class="btn btn-primary btn-block btn-flat">提交修改</button>
                    </div>
                </div>
            </form>
        </div>
    </div>
    <div class="col-md-3" style="float: left;">
        <div class="box box-danger box-solid collapsed-box">
            <div class="box-header with-border">
                <h3 class="box-title">删除题目</h3>
                <div class="box-tools pull-right">
                    <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-plus"></i>
                    </button>
                </div>
            </div>
            <div class="box-body">
                <button onclick="location.href='{{ url_for("admin.problem_delete", problem_id = problem_data.id) }}'" type="button" class="btn btn-block-btn-danger btn-flat">确认删除</button>
            </div>
        </div>
    </div>
{% endblock %}